import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class SnakeSpawner here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class SnakeSpawner extends Trap
{  
    public SnakeSpawner(int x,int del,int iniD)
    {
        super(x,del,iniD);
        
        setImage(new GreenfootImage(10,10));
    }
    
    public void act()
    {
        timer.tick();
        activeTimer.tick();
        
        if(active==true || !activeTimer.wait(initialDelay))     
        activeImage();
        if(active==false)
        return;
        
        if(timer.wait(delay))
        return;
        
        GameWorld world=(GameWorld)getWorld();
        world.addObject(new Snake(posX,0,0),world.getScrollx()+360+posX,0);
    }
}
